<template>
    <div style="z-index: 999999">
        <el-card class="box-card">
            <el-row :gutter="6" style="height: 90%;">
                <!--左tree-->
                <el-col :span="17">
                    <div>
                        <el-tabs :stretch=true type="border-card" v-model="activeName" @tab-click="chooseTabPane">
                            <el-tab-pane name="zuoxi">
                                    <span slot="label" class="tabPaneText">
                                        <template v-if="activeName == 'zuoxi'">
                                           <img class="tabPaneImg"
                                                src="@/assets/images/component/intercomGroup/zuoxiActive.png" alt="">
                                            <span class="tableTextColoraAtive">坐席</span>
                                        </template>
                                         <template v-else>
                                           <img class="tabPaneImg"
                                                src="@/assets/images/component/intercomGroup/zuoxi.png" alt="">
                                             <span class="tableTextColoraNomal">坐席</span>
                                        </template>
                                        </span>
                                <div class="tree-self tree-container">
                                    <el-tree
                                            v-if="activeName == 'zuoxi'"
                                            class="tree"
                                            :load="loadAgentChildren"
                                            show-checkbox
                                            highlight-current
                                            lazy
                                            node-key="id"
                                            :props="agentDefaultProps"
                                            :filter-node-method="filterNode"
                                            ref="agenttree"
                                            @node-expand="openChildrenHandleExpand"
                                            @node-collapse="openChildrenHandleCollapse"
                                            @check-change="handleCheckChange"

                                    >
                        <span class="custom-tree-node dataManageSelf20px" slot-scope="{ node, data }">
                              <span v-if="data.type===0"><img src="@/assets/images/mapicon/tree_fleet.png"
                                                              class="custom-tree-node-node">{{ node.label }}</span>
                              <span v-if="data.type===1"><img src="@/assets/images/mapicon/tree_fleet.png"
                                                              class="custom-tree-node-node">{{ node.label }}</span>
                              <span v-if="data.type===2"><img
                                      src="@/assets/images/component/intercomGroup/mapicon/tree_group.png"
                                      class="custom-tree-node-node">{{ node.label }}</span>
                              <span v-if="data.type===3"><img
                                      src="@/assets/images/component/intercomGroup/mapicon/tree_sub.png"
                                      class="custom-tree-node-node">{{ node.label }}</span>
                              <span v-if="data.type===5"><img
                                      src="@/assets/images/component/intercomGroup/mapicon/ddy.png"
                                      class="custom-tree-node-node">{{ node.label }}</span>
                       </span>
                                    </el-tree>
                                </div>
                            </el-tab-pane>
                            <el-tab-pane name="zzjg">
                                <span slot="label" class="tabPaneText">
                                        <template v-if="activeName == 'zzjg'">
                                           <img class="tabPaneImg"
                                                src="@/assets/images/component/intercomGroup/zzjgActive.png" alt="">
                                        <span class="tableTextColoraAtive">组织机构</span>
                                        </template>
                                         <template v-else>
                                           <img class="tabPaneImg"
                                                src="@/assets/images/component/intercomGroup/zzjg.png" alt="">
                                       <span class="tableTextColoraNomal">组织机构</span>
                                        </template>
                                        </span>
                                <div class="tree-self tree-container">
                                    <!--node-key="extnum"-->
                                    <el-tree
                                            v-if="activeName == 'zzjg'"
                                            :load="loadZZJGChildren"
                                            show-checkbox
                                            highlight-current
                                            lazy
                                            class="tree"
                                            node-key="id"
                                            :props="defaultProps"
                                            :filter-node-method="filterNode"
                                            ref="zzjgtree"
                                            @node-expand="openChildrenHandleExpand"
                                            @node-collapse="openChildrenHandleCollapse"
                                            @check-change="handleCheckChange"
                                    >
                     <span class="custom-tree-node dataManageSelf20px" slot-scope="{ node, data }">
                              <span v-if="data.type===0"><img src="@/assets/images/mapicon/tree_fleet.png"
                                                              class="custom-tree-node-node">{{ node.label }}</span>
                              <span v-if="data.type===1"><img src="@/assets/images/mapicon/tree_fleet.png"
                                                              class="custom-tree-node-node">{{ node.label }}</span>
                              <span v-if="data.type===3"><img
                                      src="@/assets/images/component/intercomGroup/mapicon/tree_group.png"
                                      class="custom-tree-node-node">{{ node.label }}</span>
                          <template v-if="data.type===2">
                                 <template v-for="(item,index) in stateAllSubTypeDatas">
                                          <span v-if="data.zhognduanTypeId===item.gloUserType">
                                              <img :src="item.url" class="zdImgClass">{{ node.label }}
                                          </span>
                                 </template>
                          </template>

                     </span>
                                    </el-tree>
                                </div>

                            </el-tab-pane>
                            <el-tab-pane name="qunzu">
                                <span slot="label" class="tabPaneText">
                                        <template v-if="activeName == 'qunzu'">
                                           <img class="tabPaneImg"
                                                src="@/assets/images/component/intercomGroup/qunzuActive.png" alt="">
                                        <span class="tableTextColoraAtive">群组</span>
                                        </template>
                                         <template v-else>
                                           <img class="tabPaneImg"
                                                src="@/assets/images/component/intercomGroup/qunzu.png" alt="">
                                       <span class="tableTextColoraNomal">群组</span>
                                        </template>
                                        </span>
                                <div class="tree-self tree-container">
                                    <el-tree
                                            v-if="activeName == 'qunzu'"
                                            check-strictly
                                            :load="loadGroupChildren"
                                            show-checkbox
                                            highlight-current
                                            lazy
                                            class="tree"
                                            node-key="id"
                                            :props="defaultProps"
                                            :filter-node-method="filterNode"
                                            ref="grouptree"
                                            @check-change="handleCheckChange"
                                    >
                        <span class="custom-tree-node dataManageSelf20px" slot-scope="{ node, data }">
                              <span v-if="data.type===0"><img src="@/assets/images/mapicon/tree_fleet.png"
                                                              class="custom-tree-node-node">{{ node.label }}</span>
                              <span v-if="data.type===1"><img src="@/assets/images/mapicon/tree_fleet.png"
                                                              class="custom-tree-node-node">{{ node.label }}</span>
                              <span v-if="data.type===3"><img
                                      src="@/assets/images/component/intercomGroup/mapicon/tree_group.png"
                                      class="custom-tree-node-node">{{ node.label }}</span>
                                 <template v-if="data.type===2">
                                     <template v-for="(item,index) in stateAllSubTypeDatas">
                                              <span v-if="data.zhognduanTypeId===item.gloUserType"><img :src="item.url"
                                                                                                        class="zdImgClass">{{ node.label }}</span>
                                     </template>
                                </template>
                       </span>
                                    </el-tree>
                                </div>

                            </el-tab-pane>
                            <el-tab-pane name="xttxl">
                                <span slot="label" class="tabPaneText">
                                        <template v-if="activeName == 'xttxl'">
                                           <img class="tabPaneImg"
                                                src="@/assets/images/component/intercomGroup/xttxlActive.png" alt="">
                                        <span class="tableTextColoraAtive">系统通讯录</span>
                                        </template>
                                         <template v-else>
                                           <img class="tabPaneImg"
                                                src="@/assets/images/component/intercomGroup/xttxl.png" alt="">
                                        <span class="tableTextColoraNomal">系统通讯录</span>
                                         </template>
                                    </span>
                                <div class="tree-self tree-container">
                                    <el-tree
                                            v-if="activeName == 'xttxl'"
                                            check-strictly
                                            :load="loadSystemAddressBookChildren"
                                            show-checkbox
                                            highlight-current
                                            lazy
                                            class="tree"
                                            ref="SystemAddressBooktree"
                                            :filter-node-method="filterNode"
                                            node-key="id"
                                            :props="SystemAddressBookdefaultProps"
                                            @check-change="handleCheckChange"
                                    >
                      <span class="custom-tree-node dataManageSelf20px" slot-scope="{ node, data }">
                              <span v-if="data.type===0"><img src="@/assets/images/mapicon/tree_fleet.png"
                                                              class="custom-tree-node-node">{{ node.label }}</span>
                              <span v-if="data.type===1"><img src="@/assets/images/mapicon/tree_fleet.png"
                                                              class="custom-tree-node-node">{{ node.label }}</span>
                              <span v-if="data.type===3"><img
                                      src="@/assets/images/component/intercomGroup/mapicon/tree_group.png"
                                      class="custom-tree-node-node">{{ node.label }}</span>
                              <template v-if="data.type===2">
                                     <template v-for="(item,index) in stateAllSubTypeDatas">
                                              <span v-if="data.zhognduanTypeId===item.gloUserType"><img :src="item.url"
                                                                                                        class="zdImgClass">{{ node.label }}</span>
                                     </template>
                                </template>
                       </span>
                                    </el-tree>
                                </div>

                            </el-tab-pane>
                            <el-tab-pane name="grtxl">
                                <span slot="label" class="tabPaneText">
                                        <template v-if="activeName == 'grtxl'">
                                           <img class="tabPaneImg"
                                                src="@/assets/images/component/intercomGroup/grtxlActive.png" alt="">
                                       <span class="tableTextColoraAtive">个人通讯录</span>
                                        </template>
                                         <template v-else>
                                           <img class="tabPaneImg"
                                                src="@/assets/images/component/intercomGroup/grtxl.png" alt="">
                                       <span class="tableTextColoraNomal">个人通讯录</span>
                                        </template>
                                    </span>
                                <div class="tree-self">
                                    <el-tree
                                            v-if="activeName == 'grtxl'"
                                            check-strictly
                                            :load="loadPersonalAddressBookChildren"
                                            show-checkbox
                                            highlight-current
                                            lazy
                                            class="tree"
                                            node-key="id"
                                            ref="PersonalAddressBooktree"
                                            :filter-node-method="filterNode"
                                            :props="defaultProps"
                                            @check-change="handleCheckChange"
                                    >
                      <span class="custom-tree-node dataManageSelf20px" slot-scope="{ node, data }">
                             <!-- <span v-if="data.type===2">

                              </span> -->
                          <span v-if="data.type===3">
                                  <img
                                          src="@/assets/images/component/intercomGroup/mapicon/tree_group.png"
                                          class="custom-tree-node-node">{{ node.label }}
                              </span>
                           <span v-if="data.type===5">
                                  <img
                                          src="@/assets/images/component/intercomGroup/mapicon/ddy.png"
                                          class="custom-tree-node-node">{{ node.label }}
                              </span> <span v-if="data.type===4">
                                  <img
                                          src="@/assets/images/component/intercomGroup/mapicon/tree_group.png"
                                          class="custom-tree-node-node">{{ node.label }}
                              </span>

                         <template v-else-if="data.type===2">
                                     <template v-for="(item,index) in stateAllSubTypeDatas">
                                              <span v-if="data.zhognduanTypeId == item.gloUserType"><img :src="item.url"
                                                                                                         class="zdImgClass">{{ node.label }}</span>
                                     </template>
                                </template>
                      </span>

                                    </el-tree>
                                </div>

                            </el-tab-pane>
                            <el-tab-pane name="bhp">
                                <span slot="label" class="tabPaneText">
                                        <template v-if="activeName == 'bhp'">
                                           <img class="tabPaneImg"
                                                src="@/assets/images/component/intercomGroup/bhpActive.png"
                                                alt="">
                                             <span class="tableTextColoraAtive">拨号盘</span>
                                        </template>
                                         <template v-else>
                                           <img class="tabPaneImg" src="@/assets/images/component/intercomGroup/bhp.png"
                                                alt="">
                                              <span class="tableTextColoraNomal">拨号盘</span>
                                        </template>
                                    </span>
                                <div class='key-container'>
                                    <div class="telBox-container">
                                        <div class="title-container">
                                            <div class="input-container" v-if="money != undefined">
                                                <div class='input-box'>{{ money }}</div>
                                                <div class="del-right">
                                                    <!--<el-button slot="append" icon="el-icon-circle-close"
                                                               @click="clearAll"></el-button>-->
                                                    <img @click="clearOne" class="bhpImg"
                                                         src="@/assets/images/component/intercomGroup/bhpDelete.png"
                                                         alt="">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="bottom-line">
                                            <el-divider></el-divider>
                                        </div>
                                        <div class="keyboard-container">
                                            <div class='keyboard' @click.stop='_handleKeyPress'>
                                                <div class='key-row'>
                                                    <div class='key-cell' data-num='1'>1</div>
                                                    <div class='key-cell' data-num='2'>2</div>
                                                    <div class='key-cell' data-num='3'>3</div>
                                                </div>
                                                <div class='key-row'>
                                                    <div class='key-cell' data-num='4'>4</div>
                                                    <div class='key-cell' data-num='5'>5</div>
                                                    <div class='key-cell' data-num='6'>6</div>
                                                </div>
                                                <div class='key-row'>
                                                    <div class='key-cell' data-num='7'>7</div>
                                                    <div class='key-cell' data-num='8'>8</div>
                                                    <div class='key-cell' data-num='9'>9</div>
                                                </div>
                                                <div class='key-row'>
                                                    <div class='key-cell' data-num='D'>清除</div>
                                                    <div class='key-cell' data-num='0'>0</div>
                                                    <div class='key-cell' data-num='QR'>确定</div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                </div>

                            </el-tab-pane>
                        </el-tabs>
                    </div>
                </el-col>
                <!--选中表格-->
                <el-col :span="7">
                    <!--已选择-->
                    <div class="isChooseD">
                        <span class="number-text">已选择({{chooseDatas.length}})个</span>
                    </div>
                    <div>
                        <!--选择后区域-->
                        <div class="chooseDatasBox">
                            <div class="chooseDatasBoxItem" v-for="item in chooseDatas" :key="item.id">
                                <div class="chooseDatasBoxItem-left">
                                    <div class="chooseDatasBoxItem-leftBox">
                                        <!--头像图片-->
                                        <div style="display: inline-block;float: left">
                                            <template v-if="item.type ===3">
                                                <img class="chooseBoxImage"
                                                     src="@/assets/icons/messages/groupLeft.png" alt="">
                                            </template>
                                            <template v-if="item.type ===2 || item.type ===5">
                                                <img class="chooseBoxImage"
                                                     src="@/assets/icons/messages/memberLeft.png"
                                                     alt="">
                                            </template>
                                        </div>
                                    </div>

                                </div>
                                <div class="chooseDatasBoxItem-center">
                                    <div class="chooseDatasBoxItem-centerBox">
                                        <div>

                                            <template v-if="GlobalFunc.getStringLength(item.name)>10">
                                                <el-tooltip offset="-2" class="item" effect="dark"
                                                            placement="top">
                                                    <div class="chooseBoxName"
                                                         style="text-overflow:ellipsis;">
                                                        {{item.name}}
                                                        <!--                                <p>二级组织</p>-->
                                                    </div>
                                                    <div slot="content">
                                                        <div class="dispatchSystemAddressBookItemText-totip">
                                                            {{item.name}}
                                                        </div>
                                                    </div>

                                                </el-tooltip>
                                                <!--   <div :title="item.name" @mouseenter="GlobalFunc.titleMouseOver($event,15)"
                                                        @mouseleave="GlobalFunc.titleMouseOut($event)" class="chooseBoxName" style="text-overflow:ellipsis;">
                                                       {{item.name}}
                                                       &lt;!&ndash;                                <p>二级组织</p>&ndash;&gt;
                                                   </div>-->

                                            </template>
                                            <template v-else>
                                                <div class="chooseBoxName" style="text-overflow:ellipsis;">
                                                    {{item.name}}
                                                    <!--                                <p>二级组织</p>-->
                                                </div>
                                            </template>
                                        </div>
                                    </div>

                                </div>
                                <div class="chooseDatasBoxItem-right">
                                    <div class="chooseDatasBoxItem-rightBox">
                                        <el-button
                                                type="danger"
                                                class="deleteBtn"

                                                @click="deleteMember(item)">
                                            删除
                                        </el-button>
                                    </div>
                                </div>

                            </div>
                        </div>
                    </div>
                </el-col>
            </el-row>

            <el-divider></el-divider>

            <el-row v-show="courentType ==='StartGroupChat'" class="fooltBtnL">
                <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="150px" class="demo-ruleForm">
                    <el-form-item label="群名称" prop="name">
                        <el-input size="medium" maxlength="22"
                                  v-model="ruleForm.name" placeholder="请输入群名称" style="width: 100%;"></el-input>
                    </el-form-item>
                </el-form>
            </el-row>
            <el-row v-show="courentType ==='intercomBoxEntranceTemp'" class="fooltBtnL">
                <el-form :model="intercomTempRuleForm" :rules="intercomTemprules" ref="intercomTemRuleForm"
                         label-width="200px" class="demo-ruleForm">
                    <el-form-item label="对讲组名称" prop="name">
                        <el-input size="medium" maxlength="8"
                                  show-word-limit v-model="intercomTempRuleForm.name"
                                  placeholder="请输入临时对讲组名称"></el-input>
                    </el-form-item>
                </el-form>
            </el-row>
            <el-row class="fooltBtn">
                <el-button @click="handleClose" size="medium" class="buttonSize20px">取消</el-button>
                <el-button type="primary" @click="handleConfirm" size="medium" class="buttonSize20px">确定</el-button>
            </el-row>
        </el-card>
    </div>
</template>

<script>
  import treeApi from '@/api/treeApi';
  import CommonChooseDialogApi from '@/api/CommonChooseDialog';
  import UserImgDatas from './userImg';
  import HomeApi from '../../api/HomeApi';  // 引入定义的方法

  export default {
    name: 'IntercomGroup',
    props: {
      msg: String,
      states: Boolean,
      addOrUpdateVisible: {
        type: Boolean,
        default: false,
      },
      userExtnum: [String, Number],
      scsAbFleetId: [String, Number],//通讯录层级
      courentType: String,
      FleetId: Number,
      userId: Number,
      UserAccount: String,
      HomePushDataToChildrenArray: Array,
    },

    data() {

      const data = [];
      return {
        activeName: 'zuoxi',
        activeRef: 'agenttree',
        formInline: {
          groupName: '',
        },
        name: '',
        rules: {
          name: [
            {required: true, message: '请输入群组名称', trigger: 'blur'},
            {min: 1, max: 20, message: '群名称最大不能超过20位字符', trigger: 'blur'},
          ],
        }, intercomTemprules: {
          name: [
            {required: true, message: '请输入临时对讲组名称', trigger: 'blur'},
            {min: 1, max: 8, message: '对讲组名称最大不能超过8位字符', trigger: 'blur'},
          ],
        },
        showMenu: false,
        saveDatas: [],//保存坐席集团数据
        defaultProps: {
          label: 'name',
          isLeaf: 'isLeaf',
        },
        ruleForm: {
          name: '',
        }, intercomTempRuleForm: {
          name: '',
        },
        SystemAddressBookdefaultProps: {
          label: 'name',
          isLeaf: 'isLeaf',
        },
        agentDefaultProps: {
          label: 'name',
          isLeaf: 'isLeaf',
        },
        money: '',
        isShowTree: true,
        //弹框
        IntercomGroup: false,
        IntercomGroup2: false,
        data: JSON.parse(JSON.stringify(data)),
        tableData: [
          {
            key: 1,
            name: '王小虎',
            address: '上海市普陀区金沙江路 1518 弄',
          }],
        chooseDatas: [],

        type: '',
        stateAllSubTypeDatas: [],
        stateAllSubTypeArr: [],
        stateAllSubTypeObj2: '',
        stateAllSubTypeObj: {
          pocID: 1,  //POC终端  1 1
          GotaID: 1,  //Gota终端 1 2
          QchatID: 1,  //Qchat终端 1 3
          DMRID: 1,  //DMR终端 1 4

          SIPZD: 1,  //RTMP源 5 1
          RTMPSPY: 1,  //监控终端 5 2
          BKQSDK: 1,  //布控球(SDK) 5 3
          BKQGBT28181: 1,  //布控球(GBT28181) 5 4
          WRJGBT28181: 1,  //无人机(GBT28181) 5 5
          HWSXT: 1,  //红外摄像头 5 6

          MNLWG: 1,  //模拟类网关 10 1
          DMRCT: 1,  //DMR 车台 10 2

          SIPZD201: 1,  //SIP终端 20 1
          NDDH202: 1,  //内调电话 20 2  内通电话
          GHZD203: 1,  //固话终端 20 3   固话电话

          SPWG: 1,  //视频网关 21 1
          DMRWG: 1,  //语音网关 21 2
          DNRZJT: 1,  //DMR中继台 21 3

        },

      };
    },
    watch: {
      // 监听 addOrUpdateVisible 改变
      addOrUpdateVisible(oldVal, newVal) {
        this.IntercomGroup = this.addOrUpdateVisible;
      },

    },
    created() {

    },
    mounted() {

      this.queryAllSubTypes();
      this.stateAllSubTypeArr = this.$store.getters.stateAllSubTypeArr;
      this.$EventBus.$on('handleHomePushDataToChildren', (array) => {
        console.log(array);
        this.$nextTick(() => {
          this.chooseDatas = array;

        });
      });
      // this.chooseDatas = this.HomePushDataToChildrenArray;
    },
    methods: {
      chooseTabPane(tab) {
        console.log(tab.name);
        this.activeName = tab.name;
        switch (tab.name) {
          case 'zuoxi':
            this.activeRef = 'agenttree';
            break;
          case 'zzjg':
            this.activeRef = 'zzjgtree';
            break;
          case 'qunzu':
            this.activeRef = 'grouptree';
            break;
          case 'xttxl':
            this.activeRef = 'SystemAddressBooktree';
            break;
          case 'grtxl'://个人通讯录
            this.activeRef = 'PersonalAddressBooktree';
            break;
          default:
            break;

        }
      },
      queryAllSubTypes() {
        HomeApi.queryAllSubType({}).then(res => {
          if (res.success) {
            let checkDatas = res.obj.list;
            let len = checkDatas.length;
            for (let i = 0; i < len; i++) {
              if (checkDatas[i].Type_ID == '1' && checkDatas[i].Sub_type_id == '1') {
                checkDatas[i]['gloUserType'] = checkDatas[i].ID;
                this.stateAllSubTypeObj.pocID = checkDatas[i].ID;//POC终端
                checkDatas[i]['url'] = require('@/assets/images/component/intercomGroup/userImg/user_1.png');
              } else if (checkDatas[i].Type_ID == '1' && checkDatas[i].Sub_type_id == '2') {
                checkDatas[i]['gloUserType'] = checkDatas[i].ID;
                this.stateAllSubTypeObj.GotaID = checkDatas[i].ID;//Gota终端
                checkDatas[i]['url'] = require('@/assets/images/component/intercomGroup/userImg/user_2.png');
              } else if (checkDatas[i].Type_ID == '1' && checkDatas[i].Sub_type_id == '3') {
                checkDatas[i]['gloUserType'] = checkDatas[i].ID;
                this.stateAllSubTypeObj.QchatID = checkDatas[i].ID;//Qchat终端
                checkDatas[i]['url'] = require('@/assets/images/component/intercomGroup/userImg/user_3.png');
              } else if (checkDatas[i].Type_ID == '1' && checkDatas[i].Sub_type_id == '4') {
                checkDatas[i]['gloUserType'] = checkDatas[i].ID;
                this.stateAllSubTypeObj.DMRID = checkDatas[i].ID;//DMR终端
                checkDatas[i]['url'] = require('@/assets/images/component/intercomGroup/userImg/user_4.png');
              } else if (checkDatas[i].Type_ID == '5' && checkDatas[i].Sub_type_id == '1') {
                checkDatas[i]['gloUserType'] = checkDatas[i].ID;
                this.stateAllSubTypeObj.SIPZD = checkDatas[i].ID;//RTMP源
                checkDatas[i]['url'] = require('@/assets/images/component/intercomGroup/userImg/user_5.png');
              } else if (checkDatas[i].Type_ID == '5' && checkDatas[i].Sub_type_id == '2') {
                checkDatas[i]['gloUserType'] = checkDatas[i].ID;
                this.stateAllSubTypeObj.RTMPSPY = checkDatas[i].ID;//监控终端
                checkDatas[i]['url'] = require('@/assets/images/component/intercomGroup/userImg/user_5.png');
              } else if (checkDatas[i].Type_ID == '5' && checkDatas[i].Sub_type_id == '3') {
                checkDatas[i]['gloUserType'] = checkDatas[i].ID;
                this.stateAllSubTypeObj.BKQSDK = checkDatas[i].ID;//布控球(SDK)
                checkDatas[i]['url'] = require('@/assets/images/component/intercomGroup/userImg/user_5.png');
              } else if (checkDatas[i].Type_ID == '5' && checkDatas[i].Sub_type_id == '4') {
                checkDatas[i]['gloUserType'] = checkDatas[i].ID;
                this.stateAllSubTypeObj.BKQGBT28181 = checkDatas[i].ID;//布控球(GBT28181)
                checkDatas[i]['url'] = require('@/assets/images/component/intercomGroup/userImg/user_5.png');
              } else if (checkDatas[i].Type_ID == '5' && checkDatas[i].Sub_type_id == '5') {
                checkDatas[i]['gloUserType'] = checkDatas[i].ID;
                this.stateAllSubTypeObj.WRJGBT28181 = checkDatas[i].ID; //无人机(GBT28181)
                checkDatas[i]['url'] = require('@/assets/images/component/intercomGroup/userImg/user_5.png');
              } else if (checkDatas[i].Type_ID == '5' && checkDatas[i].Sub_type_id == '6') {
                checkDatas[i]['gloUserType'] = checkDatas[i].ID;
                this.stateAllSubTypeObj.HWSXT = checkDatas[i].ID;//红外摄像头
                checkDatas[i]['url'] = require('@/assets/images/component/intercomGroup/userImg/user_5.png');
              } else if (checkDatas[i].Type_ID == '10' && checkDatas[i].Sub_type_id == '1') {
                checkDatas[i]['gloUserType'] = checkDatas[i].ID;
                this.stateAllSubTypeObj.MNLWG = checkDatas[i].ID;//模拟类网关
                checkDatas[i]['url'] = require('@/assets/images/component/intercomGroup/userImg/wanggaun.png');
              } else if (checkDatas[i].Type_ID == '10' && checkDatas[i].Sub_type_id == '2') {
                checkDatas[i]['gloUserType'] = checkDatas[i].ID;
                this.stateAllSubTypeObj.MNLWG = checkDatas[i].ID;//DMR 车台
                checkDatas[i]['url'] = require('@/assets/images/component/intercomGroup/userImg/user_6.png');
              } else if (checkDatas[i].Type_ID == '20' && checkDatas[i].Sub_type_id == '1') {
                checkDatas[i]['gloUserType'] = checkDatas[i].ID;
                this.stateAllSubTypeObj.SIPZD201 = checkDatas[i].ID;//SIP终端（IP话机）
                checkDatas[i]['url'] = require('@/assets/images/component/intercomGroup/userImg/huaji.png');
              } else if (checkDatas[i].Type_ID == '20' && checkDatas[i].Sub_type_id == '2') {
                checkDatas[i]['gloUserType'] = checkDatas[i].ID;
                this.stateAllSubTypeObj.NDDH202 = checkDatas[i].ID;//内调电话
                checkDatas[i]['url'] = require('@/assets/images/component/intercomGroup/userImg/huaji.png');
              } else if (checkDatas[i].Type_ID == '20' && checkDatas[i].Sub_type_id == '3') {
                checkDatas[i]['gloUserType'] = checkDatas[i].ID;
                this.stateAllSubTypeObj.GHZD203 = checkDatas[i].ID;//固话终端
                checkDatas[i]['url'] = require('@/assets/images/component/intercomGroup/userImg/huaji.png');
              } else if (checkDatas[i].Type_ID == '21' && checkDatas[i].Sub_type_id == '1') {
                checkDatas[i]['gloUserType'] = checkDatas[i].ID;
                this.stateAllSubTypeObj.spwg211 = checkDatas[i].ID;//视频网关
                checkDatas[i]['url'] = require('@/assets/images/component/intercomGroup/userImg/wanggaun.png');
              } else if (checkDatas[i].Type_ID == '21' && checkDatas[i].Sub_type_id == '2') {
                checkDatas[i]['gloUserType'] = checkDatas[i].ID;
                this.stateAllSubTypeObj.DMRWG = checkDatas[i].ID;//语音网关
                checkDatas[i]['url'] = require('@/assets/images/component/intercomGroup/userImg/wanggaun.png');
              } else if (checkDatas[i].Type_ID == '21' && checkDatas[i].Sub_type_id == '3') {
                checkDatas[i]['gloUserType'] = checkDatas[i].ID;
                this.stateAllSubTypeObj.DNRZJT = checkDatas[i].ID;//DMR中继台
                checkDatas[i]['url'] = require('@/assets/images/component/intercomGroup/userImg/user_8.png');
              } else {
                checkDatas[i]['gloUserType'] = checkDatas[i].ID;
                checkDatas[i]['url'] = require('@/assets/images/component/intercomGroup/userImg/user_999.png');
              }
            }
            // for (let i=0;i<res.obj.list.length;i++){
            //   res.obj.list[i]['gloUserType'] = res.obj.list[i].ID;
            // }
            this.stateAllSubTypeDatas = checkDatas;
          }
        }).catch(err => {
          // 异常情况
          console.log(err);
        });
      },
      //TODO 需要过滤数据请在模块中筛选
      //拨号盘确认事件
      numberAppend(data) {
        console.log('号码选中数据');
        console.log(data);
        if (data === 'undefined') {
          this.$message.warning('参数错误');
          return;
        }
        const addDatas = {};
        // addDatas.name = data.name
        addDatas.id = data.id;
        addDatas.type = data.utype;
        addDatas.extnum = data.extnum;
        addDatas.number = data.number;
        addDatas.name = data.name;
        addDatas.zhognduanTypeId = data.zhognduanTypeId;
        addDatas.zhognduanTypeName = data.zhognduanTypeName;
        /*做判断，若已选中，则提示已存在*/

        // 检测数组
        function isHasObj(arr, val) {
          var flag = false; // true为有 false为没有
          for (var i = 0; i < arr.length; i++) {
            if (JSON.stringify(arr[i]).indexOf(JSON.stringify(val)) != -1) {
              flag = true;
            }
          }
          return flag;
        }

        var keyIndex = isHasObj(this.chooseDatas, addDatas.id);
        if (keyIndex) {
          this.$message.warning('已经存在');
          return false;
        } else {
          switch (this.courentType) {
            case 'messagesAddMerber': //针对消息模块-会话添加成员过滤群组
              if (addDatas.type === 3 || addDatas.type === 1) {
                this.$message.error('不能往会话添加群组或集团！');
              } else if (addDatas.systemNumber === '102') {
                this.$message.error('无法选择话机！');
              } else {
                this.chooseDatas.push(addDatas);
              }
              break;
            case 'StartGroupChat': //针对消息模块-发起群聊
              if (addDatas.type === 3 || addDatas.type === 1) {
                this.$message.error('不能选择群组或集团创建群聊！');
              } else if (addDatas.systemNumber === '102') {
                this.$message.error('无法选择话机！');
              } else {
                this.chooseDatas.push(addDatas);
              }
              break;
            case 'intercomBoxEntranceTemp':
            case 'intercomBoxEntrancePocAdd': //针对对讲模块-过滤集团、话机,过滤调度员
              if (addDatas.type === 1) {
                this.$message.error('对讲不能选择集团！');
              } else if (addDatas.systemNumber === '102') {
                this.$message.error('无法选择话机！');
              } else if (addDatas.type == 5) {
                this.$message.error('对讲不支持添加调度员！');
              } else {
                this.chooseDatas.push(addDatas);
              }
              break;
            case 'messagesAddConversationRecord': //针对消息添加会话处理，支持固定组
              if (addDatas.type === 1) {
                this.$message.error('无法添加集团！');
              } else if (addDatas.systemNumber === '102') {
                this.$message.error('无法选择话机！');
              } else {
                this.chooseDatas.push(addDatas);
              }
              break;
            case 'messagesChoosePeopleOrMemberChat': //针对消息添加会话处理，支持固定组
              if (addDatas.type === 1) {
                this.$message.error('不能往会话添加集团！');
              } else if (addDatas.systemNumber === '102') {
                this.$message.error('无法选择话机！');
              } else {
                this.chooseDatas.push(addDatas);
              }
              break;
            case 'addConferenceMem':
            case 'inviteAppointMem':
            case 'inviteMem':
              this.chooseDatas.push(addDatas);
              break;
            case 'transferCallMany':
              this.chooseDatas.push(addDatas);
              break;
            case 'addNoticeMember':
              if (addDatas.type === 3) {
                this.$message.error('不能选择群组！');
              } else {
                this.chooseDatas.push(addDatas);
              }
              break;
            default:
              if (addDatas.type === 3) {
                this.$message.error('不能选择群组！');
              } else {
                this.chooseDatas.push(addDatas);
              }
          }
        }
      },
      filterNode: function(value, data) {
        if (!value) {
          return true;
        } else {
          return data.name.indexOf(value) !== -1;
        }
      },

      //坐席集团节点数据开始
      loadAgentChildren(node, resolve) {
        if (node.data) {
          this.getChild(node.data.fleetId, resolve);
        } else {
          setTimeout(() => { this.getChild(this.scsAbFleetId, resolve);}, 0);
        }

      },
      getChild(id, resolve) {
        var jsonData = {
          fleetId: id,
        };
        CommonChooseDialogApi.getAllChildFleetAndUser(jsonData).then(res => {
          // 返回数据
          if (res.success) {
            if (this.courentType != '' || this.courentType != 'undefined') {
              switch (this.courentType) {
                case 'intercomBoxEntranceTemp':
                case 'intercomBoxEntrancePocAdd': //对讲过滤调度员
                  var childNodes = [];
                  var changeData = res.obj;
                  if (res.obj) {
                    for (let i = 0; i < changeData.length; i++) {
                      if (changeData[i].type == 5) {
                        changeData[i].id = changeData[i].number;
                        changeData[i].isLeaf = true;
                        changeData[i].disabled = true;
                      }
                      if (changeData[i].type == 1) {
                        changeData[i].fleetId = changeData[i].id;
                        changeData[i].disabled = true;
                      }
                      if (changeData[i].number == this.$store.getters.userId) {
                        changeData[i].disabled = true;
                      }
                    }
                    childNodes = changeData;
                  }
                  resolve(childNodes);
                  break;
                case 'addNoticeMember': //广播通知过滤坐席自己
                  var childNodes = [];
                  var changeData = res.obj;
                  if (res.obj) {
                    for (let i = 0; i < changeData.length; i++) {
                      if (changeData[i].type == 5) {
                        changeData[i].id = changeData[i].number;
                        changeData[i].isLeaf = true;
                      }
                      if (changeData[i].type == 1) {
                        changeData[i].fleetId = changeData[i].id;
                        changeData[i].disabled = true;
                      }
                      if (changeData[i].number == this.$store.getters.userId) {
                        changeData[i].disabled = true;
                      }
                    }
                    childNodes = changeData;
                  }
                  resolve(childNodes);
                  break;
                case 'transferCallMany': //广播通知过滤坐席自己
                case 'transferCallSingel': //广播通知过滤坐席自己
                  var childNodes = [];
                  var changeData = res.obj;
                  if (res.obj) {
                    for (let i = 0; i < changeData.length; i++) {
                      if (changeData[i].type == 5) {
                        changeData[i].id = changeData[i].number;
                        changeData[i].isLeaf = true;
                      }
                      if (changeData[i].type == 1) {
                        changeData[i].fleetId = changeData[i].id;
                        changeData[i].disabled = true;
                      }
                      if (this.userExtnum == changeData[i].extnum) {//转接多方不能选择自己
                        changeData[i].disabled = true;
                      }
                    }
                    childNodes = changeData;
                  }
                  resolve(childNodes);
                  break;
                default:
                  var changeData = res.obj;
                  if (res.obj) {
                    for (let i = 0; i < changeData.length; i++) {
                      if (changeData[i].type == 5) {
                        changeData[i].id = changeData[i].number;
                        changeData[i].isLeaf = true;
                      }
                      if (changeData[i].type == 1) {
                        changeData[i].fleetId = changeData[i].id;
                        changeData[i].disabled = true;
                      }
                    }
                    childNodes = changeData;
                  }
                  resolve(childNodes);
              }
            }

          }
        }).catch(err => {
          // 异常情况
          console.log(err);
        });
        setTimeout(() => {
          if (this.chooseDatas.length > 0) {
            for (let i = 0; i < this.chooseDatas.length; i++) {
              var node = this.$refs.agenttree.getNode(parseInt(this.chooseDatas[i].id));
              if (node != null && node.checked === false) {
                node.checked = true;
              }
            }
          }

        }, 200);

      },

      //坐席集团节点数据结束

      //组织机构节点数据
      loadZZJGChildren(node, resolve) {
        if (node.data) {
          this.getZZJGChild(node.data.id, node.data.type, resolve);
        } else {
          setTimeout(() => {
            this.getZZJGChild(this.scsAbFleetId, 0, resolve);
          }, 0);
        }

      },
      getZZJGChild(id, type, resolve) {
        CommonChooseDialogApi.getTalk({
          parentId: id,
          type: type,
          userId: 0,
          managePriv: 0,
        }).then((res) => {
          if (this.courentType != '' || this.courentType != 'undefined') {
            if (res.success) {
              console.log(this.courentType);
              var changeData = res.obj;
              var stateAllSubTypeDatas = this.stateAllSubTypeDatas;
              for (let t = 0; t < stateAllSubTypeDatas.length; t++) {
                for (let i = 0; i < changeData.length; i++) {
                  if (stateAllSubTypeDatas[t].ID == changeData[i].subTypeId) {
                    changeData[i]['zhognduanTypeName'] = stateAllSubTypeDatas[t].name;
                    changeData[i]['zhognduanTypeId'] = stateAllSubTypeDatas[t].ID;
                    changeData[i].disabled = true;
                  }
                }

              }

              switch (this.courentType) {
                case 'messagesAddMerber': //针对消息模块-会话添加成员过滤群组
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          changeData[i].isLeaf = true;
                        }
                        if (changeData[i].type == 1 || changeData[i].type == 3) {
                          changeData[i].disabled = true;
                        }
                        //可选终端类型：16：sip电话、1：手机app（poc终端）、
                        if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID) {
                          changeData[i].disabled = false;
                        }
                      }
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                case 'messagesChoosePeopleOrMemberChat': //针对消息模块-会话添加成员
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.length > 0) {
                      changeData = res.obj;
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          changeData[i].isLeaf = true;
                        }
                        if (changeData[i].type == 1) {
                          // changeData[i].disabled = true;
                          changeData[i].disabled = true;//支持选择集团
                        }
                        //可选终端类型：16：sip电话、1：手机app（poc终端）、
                        if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID) {
                          changeData[i].disabled = false;
                        }
                      }
                      console.log('changeData');
                      console.log(changeData);
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                case 'intercomBoxEntranceTemp':
                case 'intercomBoxEntrancePocAdd': //针对对讲模块-过滤集团、话机
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          changeData[i].isLeaf = true;
                        }
                        if (changeData[i].type == 1 || changeData[i].System_type_num == '102') {
                          changeData[i].disabled = true;
                        }
                        //可选终端类型：16：sip电话、1：手机app（poc终端）、
                        if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID) {
                          changeData[i].disabled = false;
                        }
                      }
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                case 'messagesAddConversationRecord': //针对消息添加会话处理
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          changeData[i].isLeaf = true;
                        }
                        //可选终端类型：16：sip电话、1：手机app（poc终端）、
                        if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                          changeData[i].disabled = false;
                        }
                      }
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                case 'StartGroupChat': //针对消息发起群聊过滤群组
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          changeData[i].isLeaf = true;
                        }
                        if (changeData[i].type == 1 || changeData[i].type == 3) {
                          changeData[i].disabled = true;
                        }
                        //可选终端类型：16：sip电话、1：手机app（poc终端）、
                        if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID) {
                          changeData[i].disabled = false;
                        }
                      }
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                case 'addNoticeMember':
                case 'transferCallMany': //转接多方 可以转接：sip电话、调度台席、群组、手机app、
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.length > 0) {
                      changeData = res.obj;
                      for (let i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          changeData[i].isLeaf = true;
                        }
                        if (changeData[i].type == 1 || changeData[i].type == 3) {
                          changeData[i].disabled = true;
                        }
                        //可选终端类型：16：sip电话、1：手机app（poc终端）、
                        if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.NDDH202 ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.GHZD203 ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                          changeData[i].disabled = false;
                        }
                      }
                      console.log(changeData);

                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                case 'transferCallSingel':
                case 'VoipDispatchCallBridge'://转接多方 可以转接：sip电话、调度台席、群组、手机app、
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.length > 0) {
                      for (let i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          changeData[i].isLeaf = true;
                        }
                        if (changeData[i].type == 1 || changeData[i].type == 3) {
                          changeData[i].disabled = true;
                        }
                        //可选终端类型：16：sip电话、1：手机app（poc终端）、
                        if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.NDDH202 ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.GHZD203 ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                          changeData[i].disabled = false;
                        }
                      }
                      console.log('组织机构数据');
                      console.log(changeData);

                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;

                case 'addConferenceMem':
                case 'addNoticeMember':
                case 'inviteAppointMem':
                case 'inviteMem':
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.length > 0) {
                      for (let i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          changeData[i].isLeaf = true;
                        }
                        if (changeData[i].type == 1 || changeData[i].type == 3) {
                          changeData[i].disabled = true;
                        }
                        //可选终端类型：16：sip电话、1：手机app（poc终端）、
                        if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.NDDH202 ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.GHZD203 ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                          changeData[i].disabled = false;
                        }
                      }
                      console.log('组织机构数据');
                      console.log(changeData);

                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                default:
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          changeData[i].isLeaf = true;
                        }
                        if (changeData[i].type == 1) {
                          changeData[i].disabled = true;
                        }
                        //可选终端类型：16：sip电话、1：手机app（poc终端）、
                        if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.NDDH202 ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.GHZD203 ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                          changeData[i].disabled = false;
                        }
                      }
                      childNodes = changeData;

                      /*                 for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          changeData[i].isLeaf = true;
                        }
                        if (changeData[i].type == 1 || changeData[i].type == 3) {
                          changeData[i].disabled = true;
                        }
                        //可选终端类型：16：sip电话、1：手机app（poc终端）、
                        if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID || changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                          changeData[i].disabled = false;
                        }
                      }
                      childNodes = changeData;*/
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
              }
            }
          } else {
            if (res.success) {
              var childNodes = [];
              var changeData = [];
              if (res.obj && res.obj.length > 0) {
                changeData = res.obj;
                for (var i = 0; i < changeData.length; i++) {
                  if (changeData[i].type == 2) {
                    changeData[i].isLeaf = true;
                  }
                  if (changeData[i].type == 1) {
                    changeData[i].disabled = true;
                  }
                }
                childNodes = changeData;
              } else {
                /* var node = this.$refs.grouptree.getNode(id);
                 node.loading = false;
                 return*/
              }
              console.log('childNodeschildNodeschildNodes');
              console.log(childNodes);
              resolve(childNodes);
            }
          }
        }).catch(function(error) {
          console.log(error);
        });
        /*setTimeout(() => {
          if (this.chooseDatas.length > 0)
            console.log(this.chooseDatas);
          for (let i = 0; i < this.chooseDatas.length; i++) {
            var node = this.$refs.zzjgtree.getNode(parseInt(this.chooseDatas[i].extnum));
            console.log(this.chooseDatas[i].extnum);
            if (node != null && node.checked === false) {
              node.checked = true;
            }
          }

        }, 200);*/
        setTimeout(() => {
          if (this.chooseDatas.length > 0){
            console.log("已存在选择数据");
            console.log(this.chooseDatas);
            for (let i = 0; i < this.chooseDatas.length; i++) {
              var node = this.$refs.zzjgtree.getNode(parseInt(this.chooseDatas[i].id));
              console.log(this.chooseDatas[i].extnum);
              if (node != null && node.checked === false) {
                node.checked = true;
              }
            }
          }
        }, 200);

      },

      //群组节点数据
      loadGroupChildren(node, resolve) {
        if (node.data) {
          this.getGroupChild(node.data.id, node.data.type, resolve);
        } else {
          setTimeout(() => {
            this.getGroupChild(this.FleetId, 0, resolve);
          }, 0);
        }

      },
      getGroupChild(id, type, resolve) {
        CommonChooseDialogApi.getGroup({
          parentId: id,
          type: type,
          user: 0,
          managePriv: '0',
        }).then((res) => {

          if (this.courentType != '' || this.courentType != 'undefined') {
            if (res.success) {
              changeData = res.obj;
              let stateAllSubTypeDatas = this.stateAllSubTypeDatas;
              for (let t = 0; t < stateAllSubTypeDatas.length; t++) {
                for (let i = 0; i < changeData.length; i++) {
                  if (stateAllSubTypeDatas[t].ID == changeData[i].subTypeId) {
                    changeData[i]['zhognduanTypeName'] = stateAllSubTypeDatas[t].name;
                    changeData[i]['zhognduanTypeId'] = stateAllSubTypeDatas[t].ID;
                    changeData[i].disabled = true;
                  }
                }
              }
              switch (this.courentType) {

                case 'messagesAddMerber': //针对消息模块-会话添加成员过滤群组
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          changeData[i].isLeaf = true;
                        }
                        if (changeData[i].type == 1 || changeData[i].type == 3) {
                          changeData[i].disabled = true;
                        }
                      }
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                case 'addConferenceMem':
                case 'inviteMem':
                case 'inviteAppointMem':
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          changeData[i].isLeaf = true;
                          changeData[i].disabled = false;
                        } else if (changeData[i].type == 1) {
                          changeData[i].disabled = true;
                        }
                        if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.NDDH202 ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.GHZD203 ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                          changeData[i].disabled = false;
                        }
                      }
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                case 'addNoticeMember':
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          changeData[i].isLeaf = true;
                          changeData[i].disabled = false;
                        } else if (changeData[i].type == 1 || changeData[i].type == 3) {
                          changeData[i].disabled = true;
                        }
                        if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.NDDH202 ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.GHZD203 ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                          changeData[i].disabled = false;
                        }
                      }
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                case 'messagesChoosePeopleOrMemberChat': //针对消息模块-会话添加成员过滤群组
                  console.log('会话添加成员过滤群组');
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          changeData[i].isLeaf = true;
                        }
                        if (changeData[i].type == 1) {
                          changeData[i].disabled = true;
                        }
                        //可选终端类型：16：sip电话、1：手机app（poc终端）、
                        if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                          changeData[i].disabled = false;
                        }
                      }
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                case 'StartGroupChat': //针对消息发起群聊过滤群组
                  console.log('会话添加成员过滤群组');
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          changeData[i].isLeaf = true;
                        }
                        if (changeData[i].type == 1 || changeData[i].type == 3) {
                          changeData[i].disabled = true;
                        }
                        //可选终端类型：16：sip电话、1：手机app（poc终端）、
                        if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID) {
                          changeData[i].disabled = false;
                        }
                      }
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                case 'intercomBoxEntranceTemp':
                case 'intercomBoxEntrancePocAdd': //针对对讲模块-过滤集团、话机
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          changeData[i].disabled = true;
                          changeData[i].isLeaf = true;
                        }
                        if (changeData[i].type == 1) {
                          changeData[i].disabled = true;
                        }
                        //可选终端类型：16：sip电话、1：手机app（poc终端）、
                        if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID) {
                          changeData[i].disabled = false;
                        }
                      }
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                case 'messagesAddConversationRecord': //针对消息添加会话处理
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          changeData[i].isLeaf = true;
                        }
                        //可选终端类型：16：sip电话、1：手机app（poc终端）、
                        if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                          changeData[i].disabled = false;
                        }
                      }
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                case 'addNoticeMember':
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          changeData[i].isLeaf = true;
                        }
                        if (changeData[i].type == 1 || changeData[i].System_type_num == '102') {
                          changeData[i].disabled = true;
                        }
                        //可选终端类型：16：sip电话、1：手机app（poc终端）、
                        if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.NDDH202 ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.GHZD203 ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                          changeData[i].disabled = false;
                        }
                      }
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                case 'transferCallMany': //转接多方 可以转接：sip电话、调度台席、群组、手机app、
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          changeData[i].isLeaf = false;
                        }
                        if (changeData[i].type == 1) {
                          changeData[i].disabled = true;
                        }
                        //可选终端类型：16：sip电话、1：手机app（poc终端）、
                        if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.NDDH202 ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.GHZD203 ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                          changeData[i].disabled = false;
                        }
                      }
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                case 'transferCallSingel':
                case 'VoipDispatchCallBridge'://转接多方 可以转接：sip电话、调度台席、群组、手机app、
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          changeData[i].isLeaf = true;
                        }
                        //可选终端类型：16：sip电话、1：手机app（poc终端）、
                        if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.NDDH202 ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.GHZD203 ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                          changeData[i].disabled = false;
                        }
                      }
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                default:
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          changeData[i].isLeaf = true;
                        }
                        if (changeData[i].type == 1) {
                          changeData[i].disabled = true;
                        }
                        //可选终端类型：16：sip电话、1：手机app（poc终端）、
                        if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                          changeData[i].disabled = false;
                        }
                      }
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
              }
            }
          } else {
            if (res.success) {
              var childNodes = [];
              var changeData = [];
              if (res.obj && res.obj.length > 0) {
                changeData = res.obj;
                for (var i = 0; i < changeData.length; i++) {
                  if (changeData[i].type == 2) {
                    changeData[i].isLeaf = true;
                  }
                  if (changeData[i].type == 1) {
                    changeData[i].disabled = true;
                  }
                }
                childNodes = changeData;
              } else {
                /* var node = this.$refs.grouptree.getNode(id);
                 node.loading = false;
                 return*/
              }
              resolve(childNodes);
            }
          }

        }).catch(function(error) {
          console.log(error);
        });
        setTimeout(() => {
          if (this.chooseDatas.length > 0) {
            for (let i = 0; i < this.chooseDatas.length; i++) {
              var node = this.$refs.grouptree.getNode(parseInt(this.chooseDatas[i].extnum));
              if (node != null && node.checked === false) {
                node.checked = true;
              }
            }
          }

        }, 200);

      },

      //系统通讯录
      loadSystemAddressBookChildren(node, resolve) {
        if (node.data) {
          this.getSystemAddressBookChildrenChildMemberTableData(node.data.id, resolve);
        } else {
          setTimeout(() => {
            this.getSystemAddressBookChildrenChild(this.scsAbFleetId, 0, resolve);
          }, 0);
        }
      },
      getSystemAddressBookChildrenChild(id, type, resolve) {
        CommonChooseDialogApi.getSystemAddressBook(
            {
              fleetId: id,
              pageNum: 1,
              pageSize: 10000,
            },
        ).then(function(res) {
          if (res.success) {
            /**/
            var childNodes = [];
            var changeData = [];
            if (res.obj && res.obj.list.length > 0) {
              changeData = res.obj.list;
              for (var i = 0; i < changeData.length; i++) {
                changeData[i]['type'] = 3;
                changeData[i]['number'] = changeData[i].NUMBER;
                changeData[i].disabled = true;
              }
              childNodes = changeData;
            } else {
              /* var node = this.$refs.grouptree.getNode(id);
               node.loading = false;
               return*/
            }
            resolve(childNodes);
          }
        }).catch(function(error) {
          console.log(error);
        });
      },
      //获取系统通讯录成员
      getSystemAddressBookChildrenChildMemberTableData(id, resolve) {
        CommonChooseDialogApi.getMemberTableData(
            {
              groupId: id,
            },
        ).then((res) => {
          if (this.courentType != '' || this.courentType != 'undefined') {
            if (res.success) {
              let changeData = res.obj.list;
              let stateAllSubTypeDatas = this.stateAllSubTypeDatas;
              for (let t = 0; t < stateAllSubTypeDatas.length; t++) {
                for (let i = 0; i < changeData.length; i++) {
                  if (stateAllSubTypeDatas[t].ID == changeData[i].subTypeId) {
                    changeData[i]['zhognduanTypeName'] = stateAllSubTypeDatas[t].name;
                    changeData[i]['zhognduanTypeId'] = stateAllSubTypeDatas[t].ID;
                    changeData[i]['number'] = changeData[i].NUMBER;
                    changeData[i].disabled = true;
                  }
                }
              }

              switch (this.courentType) {
                case 'addConferenceMem':
                case 'addNoticeMember':
                case 'inviteAppointMem':
                case 'inviteMem':
                case 'transferCallMany': //转接多方 可以转接：sip电话、调度台席、群组、手机app、
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.list.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        changeData[i]['type'] = 2;
                        changeData[i]['id'] = changeData[i].subId;
                        changeData[i]['name'] = changeData[i].subName;
                        changeData[i].isLeaf = true;
                        //可选终端类型：16：sip电话、1：手机app（poc终端）、
                        if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.NDDH202 ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.GHZD203 ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                          changeData[i].disabled = false;
                        }
                      }
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                case 'intercomBoxEntranceTemp':
                case 'intercomBoxEntrancePocAdd': //针对对讲模块-过滤集团、话机
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.list.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        changeData[i]['type'] = 2;
                        changeData[i]['id'] = changeData[i].subId;
                        changeData[i]['name'] = changeData[i].subName;
                        changeData[i].isLeaf = true;
                        //可选终端类型：16：sip电话、1：手机app（poc终端）、
                        if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID) {
                          changeData[i].disabled = false;
                        }
                      }
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                case 'addNoticeMember':
                case 'transferCallSingel':
                case 'VoipDispatchCallBridge'://转接多方 可以转接：sip电话、调度台席、群组、手机app、
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.list.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        changeData[i]['type'] = 2;
                        changeData[i]['id'] = changeData[i].subId;
                        changeData[i]['name'] = changeData[i].subName;
                        changeData[i].isLeaf = true;
                        //可选终端类型：16：sip电话、1：手机app（poc终端）、
                        if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.NDDH202 ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.GHZD203 ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                          changeData[i].disabled = false;
                        }
                      }
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                default:
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.list.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        changeData[i]['type'] = 2;
                        changeData[i]['id'] = changeData[i].subId;
                        changeData[i]['name'] = changeData[i].subName;
                        changeData[i].isLeaf = true;
                        //可选终端类型：16：sip电话、1：手机app（poc终端）、
                        if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID ||
                            changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                          changeData[i].disabled = false;
                        }
                      }
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
              }
            }
            setTimeout(() => {
              if (this.chooseDatas.length > 0) {
                for (let i = 0; i < this.chooseDatas.length; i++) {
                  var node = this.$refs.SystemAddressBooktree.getNode(parseInt(this.chooseDatas[i].extnum));
                  if (node != null && node.checked === false) {
                    node.checked = true;
                  }
                }
              }

            }, 200);

          }

        }).catch(function(error) {
          console.log(error);
        });

      },

      //个人通讯录
      loadPersonalAddressBookChildren(node, resolve) {
        if (node.data) {
          console.log(node.data);
          // this.getSystemAddressBookChildrenChildMemberTableData(node.data.id, resolve)
        if(node.data.type ==3){
          this.getSystemAddressBookChildrenChildGroupMember(node.data.conId, node.data.extnum, resolve);
        }else {
          console.log("自定义组");
          this.getPersonalAddressSelfGroupMember(node.data.id, 1, resolve);

        }
        } else {
          setTimeout(() => {
            this.getPersonalAddressBookChildren(this.UserAccount, 0, resolve);
          }, 0);
        }
      },
      //个人通讯录数据
      getPersonalAddressBookChildren(id, type, resolve) {
        CommonChooseDialogApi.getPersonalAddressBook(
            {
              userId: id,//管理员登录id,登录编号
              pageNum: 1,
              pageSize: 10000,
            },
        ).then((res) => {

          if (this.courentType != '' || this.courentType != 'undefined') {
            if (res.success) {
              let changeData = res.obj.list;
              for (let i = 0; i < changeData.length; i++) {
                //0:终端》》2，1群组》》3，2未知号码，3调度员》》5，4自定义群组
                switch (changeData[i].type) {
                  case 0:
                    changeData[i]['zhognduanTypeId'] = parseInt(changeData[i].subTypeId);
                    changeData[i]['number'] = changeData[i].number;
                    changeData[i].disabled = true;
                    changeData[i].type = 2;
                    changeData[i].isLeaf = true;
                    break;
                  case 1://群组
                    changeData[i].type = 3;
                    break;
                  case 2://未知号码，过滤掉
                    changeData.splice(i, 1);
                    break;
                  case 3://调度员
                    changeData[i].type = 5;
                    changeData[i].isLeaf = true;
                    changeData[i].disabled = false;
                    break;
                  case 4:
                    changeData[i].type = 4;
                    changeData[i].disabled = true;
                    break;
                }

              }
              console.log('changeD989854954ata');
              console.log(changeData);
              switch (this.courentType) {
                case 'messagesAddMerber': //针对消息模块-会话添加成员过滤群组
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.list.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {//终端
                          changeData[i].isLeaf = true;
                          //可选终端类型：16：sip电话、1：手机app（poc终端）、
                          if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID) {
                            changeData[i].disabled = false;
                          }
                        } else if (changeData[i].type == 3) {//群组
                          changeData[i].id = changeData[i].conId;
                          changeData[i].disabled = true;
                        }else if (changeData[i].type == 5) {//调度员
                          changeData[i].disabled = false;
                        }

                      }
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                case 'addNoticeMember':
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.list.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          changeData[i].isLeaf = true;
                          //可选终端类型：16：sip电话、1：手机app（poc终端）、
                          if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID ||
                              changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.NDDH202 ||
                              changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.GHZD203 ||
                              changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                            changeData[i].disabled = false;
                          }
                        } else if (changeData[i].type == 3) {
                          changeData[i].id = changeData[i].conId;
                          changeData[i].disabled = true;
                        }

                      }
                      childNodes = changeData;
                      resolve(childNodes);

                    } else {
                      var node = this.$refs.PersonalAddressBooktree.getNode(extnum);
                      node.loading = false;
                      return;
                    }
                  }
                  break;
                case 'addConferenceMem':
                case 'inviteAppointMem':
                case 'inviteMem':
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.list.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          changeData[i].isLeaf = true;
                          changeData[i].disabled = true;
                          //可选终端类型：16：sip电话、1：手机app（poc终端）、
                          if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID ||
                              changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.NDDH202 ||
                              changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.GHZD203 ||
                              changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                            changeData[i].disabled = false;
                          }
                        } else if (changeData[i].type == 3) {
                          changeData[i].id = changeData[i].conId;
                          changeData[i].disabled = true;
                        }

                      }
                      childNodes = changeData;
                      resolve(childNodes);

                    } else {
                      var node = this.$refs.PersonalAddressBooktree.getNode(extnum);
                      node.loading = false;
                      return;
                    }
                  }
                  break;
                case 'messagesChoosePeopleOrMemberChat': //针对消息模块-会话添加成员过滤群组
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.list.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          changeData[i].isLeaf = true;
                          if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID) {
                            changeData[i].disabled = false;
                          }
                        }

                      }
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                case 'StartGroupChat': //针对消息模块-会话添加成员过滤群组
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.list.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          changeData[i].isLeaf = true;
                          //可选终端类型：16：sip电话、1：手机app（poc终端）、
                          if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID) {
                            changeData[i].disabled = false;
                          }
                        } else if (changeData[i].type == 3) {
                          changeData[i].id = changeData[i].conId;
                          changeData[i].disabled = true;
                        }

                      }
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                case 'intercomBoxEntranceTemp':
                case 'intercomBoxEntrancePocAdd': //针对对讲模块-过滤集团、话机
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.list.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          changeData[i].isLeaf = true;
                          //可选终端类型：16：sip电话、1：手机app（poc终端）、
                          if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID) {
                            changeData[i].disabled = false;
                          }
                        } else if (changeData[i].type == 3) {
                          changeData[i].id = changeData[i].conId;
                        }else if (changeData[i].type == 5) {
                          changeData[i].disabled = true;
                          changeData[i].id = changeData[i].conId;
                        }

                      }
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                case 'messagesAddConversationRecord': //针对消息添加会话处理
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.list.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          changeData[i].isLeaf = true;
                          //可选终端类型：16：sip电话、1：手机app（poc终端）、
                          if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID ||
                              changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                            changeData[i].disabled = false;
                          }
                        } else if (changeData[i].type == 3) {
                          changeData[i].id = changeData[i].conId;
                        }

                      }
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                case 'transferCallMany': //转接多方 可以转接：sip电话、调度台席、群组、手机app、
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.list.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          changeData[i].isLeaf = false;
                          //可选终端类型：16：sip电话、1：手机app（poc终端）、
                          if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID ||
                              changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.NDDH202 ||
                              changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.GHZD203 ||
                              changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                            changeData[i].disabled = false;
                          }
                        } else if (changeData[i].type == 3) {
                          changeData[i].id = changeData[i].conId;
                        }

                      }
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                case 'transferCallSingel':
                case 'VoipDispatchCallBridge'://转接多方 可以转接：sip电话、调度台席、群组、手机app、
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.list.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          changeData[i].isLeaf = true;
                          //可选终端类型：16：sip电话、1：手机app（poc终端）、
                          if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID ||
                              changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.NDDH202 ||
                              changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.GHZD203 ||
                              changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                            changeData[i].disabled = false;
                          }
                        } else if (changeData[i].type == 3) {
                          changeData[i].id = changeData[i].conId;
                        }

                      }
                      console.log(changeData);
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                default:
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.list.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          changeData[i].isLeaf = true;
                          //可选终端类型：16：sip电话、1：手机app（poc终端）、
                          if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID ||
                              changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                            changeData[i].disabled = false;
                          }
                        } else if (changeData[i].type == 3) {
                          changeData[i].id = changeData[i].conId;
                        }

                      }
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
              }
            }

          } else {
            if (res.success) {
              var childNodes = [];
              var changeData = [];
              if (res.obj && res.obj.list.length > 0) {
                changeData = res.obj.list;
                for (var i = 0; i < changeData.length; i++) {
                  if (changeData[i].type == 2) {
                    changeData[i].isLeaf = true;
                  }
                }
                childNodes = changeData;
              } else {
                /* var node = this.$refs.grouptree.getNode(id);
                 node.loading = false;
                 return*/
              }
              resolve(childNodes);
            }
          }
          setTimeout(() => {
            for (let i = 0; i < this.chooseDatas.length; i++) {
              var node = this.$refs.PersonalAddressBooktree.getNode(parseInt(this.chooseDatas[i].extnum));
              console.log(this.chooseDatas[i].extnum);
              if (node != null && node.checked === false) {
                node.checked = true;
              }
            }
          }, 200);
        }).catch(function(error) {
          console.log(error);
        });
      },
      //查询通讯录自定义组成员
      getPersonalAddressSelfGroupMember(id, type, resolve) {
        let data = {
          groupId: id
        }
        CommonChooseDialogApi.queryCustomizeGrpMemA(data).then((res) => {

          if (this.courentType != '' || this.courentType != 'undefined') {
            if (res.success) {
              let changeData = res.obj;
              for (let i = 0; i < changeData.length; i++) {
                switch (changeData[i].type) {
                  case 0:
                    changeData[i]['zhognduanTypeId'] = parseInt(changeData[i].subTypeId);
                    changeData[i]['number'] = changeData[i].number;
                    changeData[i].disabled = true;
                    changeData[i].type = 2;
                    changeData[i].isLeaf = true;
                    break;
                  case 1://调度员
                    changeData[i].type = 5;
                    changeData[i].isLeaf = true;
                    break;
                }

              }
              switch (this.courentType) {
                case 'messagesAddMerber': //针对消息模块-会话添加成员过滤群组
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {//终端
                          //可选终端类型：16：sip电话、1：手机app（poc终端）、
                          if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID) {
                            changeData[i].disabled = false;
                          }
                        }

                      }
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                case 'addNoticeMember':
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          //可选终端类型：16：sip电话、1：手机app（poc终端）、
                          if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID ||
                              changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.NDDH202 ||
                              changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.GHZD203 ||
                              changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                            changeData[i].disabled = false;
                          }
                        }
                      }
                      childNodes = changeData;
                      resolve(childNodes);

                    } else {
                      var node = this.$refs.PersonalAddressBooktree.getNode(extnum);
                      node.loading = false;
                      return;
                    }
                  }
                  break;
                case 'addConferenceMem':
                case 'inviteAppointMem':
                case 'inviteMem':
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          //可选终端类型：16：sip电话、1：手机app（poc终端）、
                          if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID ||
                              changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.NDDH202 ||
                              changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.GHZD203 ||
                              changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                            changeData[i].disabled = false;
                          }
                        }
                      }
                      childNodes = changeData;
                      resolve(childNodes);

                    } else {
                      var node = this.$refs.PersonalAddressBooktree.getNode(extnum);
                      node.loading = false;
                      return;
                    }
                  }
                  break;
                case 'messagesChoosePeopleOrMemberChat': //针对消息模块-会话添加成员过滤群组
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {//

                          //可选终端类型：16：sip电话、1：手机app（poc终端）、
                          if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID) {
                            changeData[i].disabled = false;
                          }
                        }
                      }
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                case 'StartGroupChat': //针对消息模块-会话添加成员过滤群组
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {

                          //可选终端类型：16：sip电话、1：手机app（poc终端）、
                          if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID) {
                            changeData[i].disabled = false;
                          }
                        }
                      }
                      console.log('changeData');
                      console.log(changeData);
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                case 'intercomBoxEntranceTemp':
                case 'intercomBoxEntrancePocAdd': //针对对讲模块-过滤集团、话机
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                        //可选终端类型：16：sip电话、1：手机app（poc终端）、
                        if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID) {
                          changeData[i].disabled = false;
                        }
                        }
                      }
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                case 'messagesAddConversationRecord': //针对消息添加会话处理
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          //可选终端类型：16：sip电话、1：手机app（poc终端）、
                          if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID ||
                              changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                            changeData[i].disabled = false;
                          }
                        }
                      }
                      console.log(';;;changeData');
                      console.log(changeData);
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                case 'transferCallMany': //转接多方 可以转接：sip电话、调度台席、群组、手机app、
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 0) {
                          //可选终端类型：16：sip电话、1：手机app（poc终端）、
                          if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID ||
                              changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.NDDH202 ||
                              changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.GHZD203 ||
                              changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                            changeData[i].disabled = false;
                          }
                        }
                      }
                      console.log(changeData);
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                case 'transferCallSingel':
                case 'VoipDispatchCallBridge'://转接多方 可以转接：sip电话、调度台席、群组、手机app、
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          //可选终端类型：16：sip电话、1：手机app（poc终端）、
                          if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID ||
                              changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.NDDH202 ||
                              changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.GHZD203 ||
                              changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                            changeData[i].disabled = false;
                          }
                        }
                      }
                      console.log(changeData);
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
                  break;
                default:
                  if (res.success) {
                    var childNodes = [];
                    if (res.obj && res.obj.length > 0) {
                      for (var i = 0; i < changeData.length; i++) {
                        if (changeData[i].type == 2) {
                          //可选终端类型：16：sip电话、1：手机app（poc终端）、
                          if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID ||
                              changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                            changeData[i].disabled = false;
                          }
                        }
                      }
                      console.log(';;;changeData');
                      console.log(changeData);
                      childNodes = changeData;
                    } else {
                      /* var node = this.$refs.grouptree.getNode(id);
                       node.loading = false;
                       return*/
                    }
                    resolve(childNodes);
                  }
              }
            }

          } else {
            if (res.success) {
              var childNodes = [];
              var changeData = [];
              if (res.obj && res.obj.length > 0) {
                changeData = res.obj;
                console.log(changeData);
                childNodes = changeData;
              } else {
                /* var node = this.$refs.grouptree.getNode(id);
                 node.loading = false;
                 return*/
              }
              resolve(childNodes);
            }
          }
          setTimeout(() => {
            for (let i = 0; i < this.chooseDatas.length; i++) {
              var node = this.$refs.PersonalAddressBooktree.getNode(parseInt(this.chooseDatas[i].extnum));
              console.log(this.chooseDatas[i].extnum);
              if (node != null && node.checked === false) {
                node.checked = true;
              }
            }
          }, 200);
        }).catch(function(error) {
          console.log(error);
        });
      },
      //个人通讯录获取组成员
      getSystemAddressBookChildrenChildGroupMember(id, extnum, resolve) {
        CommonChooseDialogApi.queryGroupMember(
            {
              groupId: id,
            },
        ).then((res) => {
          if (this.courentType != '' || this.courentType != 'undefined') {
            let changeData = res.rows;
            for (let i = 0; i < changeData.length; i++) {
              changeData[i]['zhognduanTypeId'] = changeData[i].subTypeId;
              changeData[i]['number'] = changeData[i].subNumber;
              changeData[i].disabled = true;
            }
            console.log(changeData);
            switch (this.courentType) {
              case 'addConferenceMem':
              case 'addNoticeMember':
              case 'inviteAppointMem':
              case 'inviteMem':
              case 'addNoticeMember':
              case 'transferCallMany': //转接多方 可以转接：sip电话、调度台席、群组、手机app、
                if (res.rows.length > 0) {
                  console.log(res);
                  var childNodes = [];
                  for (var i = 0; i < changeData.length; i++) {
                    changeData[i]['type'] = 2;
                    changeData[i]['id'] = changeData[i].subId;
                    // changeData[i]['name'] =changeData[i].name;
                    changeData[i].isLeaf = true;
                    //可选终端类型：16：sip电话、1：手机app（poc终端）、
                    if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID ||
                        changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.NDDH202 ||
                        changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.GHZD203 ||
                        changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                      changeData[i].disabled = false;
                    }
                  }
                  console.log(changeData);
                  childNodes = changeData;
                  resolve(childNodes);
                } else {
                  /* var node = this.$refs.personaltree.getNode(id);
                   node.loading = false;
                   return*/
                  console.log(id);
                  var node = this.$refs.PersonalAddressBooktree.getNode(extnum);
                  node.isLeaf = true;
                  node.loading = false;
                }
                break;
              case 'transferCallSingel':
              case 'VoipDispatchCallBridge'://转接多方 可以转接：sip电话、调度台席、群组、手机app、
                if (res.rows.length > 0) {
                  console.log(res);
                  var childNodes = [];
                  for (var i = 0; i < changeData.length; i++) {
                    changeData[i]['type'] = 2;
                    changeData[i]['id'] = changeData[i].subId;
                    // changeData[i]['name'] =changeData[i].name;
                    changeData[i].isLeaf = true;
                    //可选终端类型：16：sip电话、1：手机app（poc终端）、
                    if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID ||
                        changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.NDDH202 ||
                        changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.GHZD203 ||
                        changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                      changeData[i].disabled = false;
                    }

                  }
                  console.log(changeData);
                  childNodes = changeData;
                  resolve(childNodes);
                } else {
                  /* var node = this.$refs.personaltree.getNode(id);
                   node.loading = false;
                   return*/
                  console.log(id);
                  var node = this.$refs.PersonalAddressBooktree.getNode(extnum);
                  node.isLeaf = true;
                  node.loading = false;
                }
                break;
              default:
                if (res.rows.length > 0) {
                  var childNodes = [];
                  console.log(changeData);
                  for (var i = 0; i < changeData.length; i++) {
                    changeData[i]['type'] = 2;
                    changeData[i]['id'] = changeData[i].subId;
                    // changeData[i]['name'] =changeData[i].name;
                    changeData[i].isLeaf = true;
                    //可选终端类型：16：sip电话、1：手机app（poc终端）、
                    if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID ||
                        changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                      changeData[i].disabled = false;
                    }
                  }
                  childNodes = changeData;
                  resolve(childNodes);
                } else {
                  var node = this.$refs.PersonalAddressBooktree.getNode(extnum);
                  node.isLeaf = true;
                  node.loading = false;
                }

            }

          }

        }).catch(function(error) {
          console.log(error);
        });
        setTimeout(() => {
          for (let i = 0; i < this.chooseDatas.length; i++) {
            var node = this.$refs.PersonalAddressBooktree.getNode(parseInt(this.chooseDatas[i].extnum));
            console.log(this.chooseDatas[i].extnum);
            if (node != null && node.checked === false) {
              node.checked = true;
            }
          }
        }, 200);
      },

      //勾选数据函数
      handleCheckChangeBNE: function(data, checked, indeterminate) {
        console.log(data);
        if (checked) {
          var nodeObj = {};
          nodeObj.id = data.id;
          nodeObj.type = data.type;
          nodeObj.extnum = data.extnum;
          nodeObj.number = data.number;
          nodeObj.systemNumber = data.System_type_num;
          nodeObj.zhognduanTypeId = data.zhognduanTypeId;
          nodeObj.zhognduanTypeName = data.zhognduanTypeName;
          nodeObj.name = data.name;
          var length = false;
          for (var i = 0; i < this.chooseDatas.length; i++) {
            if (data.id === this.chooseDatas[i].id) {
              length = true;
            }
          }

          // 检测数组
          function isHasObj(arr, val) {
            var flag = false; // true为有 false为没有
            for (var i = 0; i < arr.length; i++) {
              if (JSON.stringify(arr[i]).indexOf(JSON.stringify(val)) != -1) {
                flag = true;
              }
            }
            return flag;
          }

          if (!length) {
            if (this.courentType != '' || this.courentType != 'undefined') {
              switch (this.courentType) {
                case 'transferCallSingel': //转接 只能选择单个
                case 'VoipDispatchCallBridge': //转接 只能选择单个
                  this.chooseDatas.push(nodeObj);
                  if (this.chooseDatas.length > 1) {
                    this.$message.warning('转接不能多选');
                    for (var i = 0; i < this.chooseDatas.length; i++) {
                      if (data.id === this.chooseDatas[i].id) {
                        this.deleteMember(data.extnum);
                      }
                    }
                  } else {

                  }
                  break;

                default:
                  var keyIndex = isHasObj(this.chooseDatas, nodeObj.number);
                  if (keyIndex) {
                    // this.$message.warning('已经存在');
                    return false;
                  } else {
                    this.chooseDatas.push(nodeObj);

                  }

              }
            }
          }

        } else if (!checked) {
          for (var i = 0; i < this.chooseDatas.length; i++) {
            if (data.extnum === this.chooseDatas[i].extnum) {
              this.chooseDatas.splice(i, 1);
            }
          }
        }
      }, //勾选数据函数
      /**
       *
       * 共三个参数，依次为：传递给 data 属性的数组中该节点所对应的对象、节点本身是否被选中、节点的子树中是否有被选中的节点
       * */
      handleCheckChange(data, checked, indeterminate) {
        console.log("选择数据");
        console.log(data);
        let getCourentRef = this.activeRef;
        try {
          var childNodesDatas = this.$refs[getCourentRef].getNode(data.id);

        }catch (e) {
          ;
        }


        //判断节点是否为集团
        if (checked) {
          switch (data.type) {
            case 1://部门
              if (this.activeRef == 'agenttree') {
                this.agentChooseDatas(data, childNodesDatas);
              } else {
                this.feeltChooseDatas(data, childNodesDatas);
              }
              break;
            default :
              this.defaultChooseData(data);
              break;

          }

        } else if (!checked) {
          console.log("数据类型："+data.type);
          switch (data.type) {

            case 1:
              console.log('删除部门下所有合格成员');
              // this.deleteAllNotChooseData(childNodesDatas);
              break;
            default :
              console.log("删除一条数据");
              for (var i = 0; i < this.chooseDatas.length; i++) {
                if (data.extnum === this.chooseDatas[i].extnum) {
                  this.chooseDatas.splice(i, 1);
                }
              }
              break;

          }
        }
        //普通节点放行
        console.log('半选中');
        console.log(this.$refs[getCourentRef].getCheckedKeys().concat(this.$refs[getCourentRef].getHalfCheckedKeys()));
        return this.$refs[getCourentRef].getCheckedKeys().concat(this.$refs[getCourentRef].getHalfCheckedKeys());
      },
      /**
       * 节点展开
       * */
      openChildrenHandleExpand(courentData, nodeData, VueComponent) {
        console.log('节点展开');
        if (courentData.type == 1) {
          this.$nextTick(() => {
            let node1 = this.$refs[this.activeRef].getNode(courentData.id);
            console.log(node1);
            console.log('展开后支持选中');
            node1.data.disabled = false;
          });
        }

      },
      /**
       * 节点关闭
       * */
      openChildrenHandleCollapse(courentData, nodeData, VueComponent) {
        console.log('节点关闭');
        if (courentData.type == 1) {
          this.$nextTick(() => {
            let node1 = this.$refs[this.activeRef].getNode(courentData.id);
            node1.data.disabled = true;
          });
        }

      },

      checkZZJGChildrenHandle(courentData, nodeData, VueComponent) {
        console.log('节点被点击');
        console.log(courentData);
        console.log(nodeData);
        console.log(VueComponent);
        console.log('节点被点击');

      },

      /**
       * 默认选择数据，针对单个
       * @param data
       */
      defaultChooseData(data) {
        var nodeObj = {};
        nodeObj.id = data.id;
        nodeObj.type = data.type;
        nodeObj.extnum = data.extnum;
        nodeObj.number = data.number;
        nodeObj.systemNumber = data.System_type_num;
        nodeObj.zhognduanTypeId = data.zhognduanTypeId;
        nodeObj.zhognduanTypeName = data.zhognduanTypeName;
        nodeObj.name = data.name;
        var length = false;
        for (var i = 0; i < this.chooseDatas.length; i++) {
          if (data.id === this.chooseDatas[i].id) {
            length = true;
          }
        }

        // 检测数组
        function isHasObj(arr, val) {
          var flag = false; // true为有 false为没有
          for (var i = 0; i < arr.length; i++) {
            if (JSON.stringify(arr[i]).indexOf(JSON.stringify(val)) != -1) {
              flag = true;
            }
          }
          return flag;
        }

        if (!length) {
          if (this.courentType != '' || this.courentType != 'undefined') {
            switch (this.courentType) {
              case 'transferCallSingel': //转接 只能选择单个
              case 'VoipDispatchCallBridge': //转接 只能选择单个
                this.chooseDatas.push(nodeObj);
                if (this.chooseDatas.length > 1) {
                  this.$message.warning('转接不能多选');
                  for (var i = 0; i < this.chooseDatas.length; i++) {
                    if (data.id === this.chooseDatas[i].id) {
                      this.deleteMember(data.extnum);
                    }
                  }
                } else {

                }
                break;

              default:
                var keyIndex = isHasObj(this.chooseDatas, nodeObj.number);
                if (keyIndex) {
                  // this.$message.warning('已经存在');
                  return false;
                } else {
                  this.chooseDatas.push(nodeObj);

                }

            }
          }
        }

      },
      /**
       * 选择集团，选择下成员
       * @param data
       * @returns {boolean}
       */
      agentChooseDatas(parentData, childNodesDatas) {
        console.log('当前节点数据');
        console.log(childNodesDatas);

        function isHasObj(arr, val) {
          var flag = false; // true为有 false为没有
          for (var i = 0; i < arr.length; i++) {
            if (JSON.stringify(arr[i]).indexOf(JSON.stringify(val)) != -1) {
              flag = true;
            }
          }
          return flag;
        }

        let childNodes = childNodesDatas.childNodes;
        if (childNodes.length > 0) {
          for (let n = 0; n < childNodes.length; n++) {
            if (childNodes[n].data.type == 2 || childNodes[n].data.type == 5) {
              var nodeObj = {};
              let data = childNodes[n].data;
              console.log(data);
              nodeObj.id = data.id;
              nodeObj.type = data.type;
              nodeObj.extnum = data.extnum;
              nodeObj.number = data.number;
              nodeObj.systemNumber = data.System_type_num;
              nodeObj.zhognduanTypeName = data.zhognduanTypeName;
              nodeObj.name = data.name;
              var keyIndex = isHasObj(this.chooseDatas, nodeObj.number);
              if (keyIndex) {
                return false;
              } else {
                if (this.courentType != '' || this.courentType != 'undefined') {
                  switch (this.courentType) {
                    case 'transferCallSingel': //转接 只能选择单个
                    case 'VoipDispatchCallBridge': //转接 只能选择单个
                      if (this.chooseDatas.length > 1) {
                        // this.$message.warning('转接不能多选');
                        for (var i = 0; i < this.chooseDatas.length; i++) {
                          if (nodeObj.id === this.chooseDatas[i].id) {
                            this.deleteMember(nodeObj);
                          }
                        }
                      }
                      break;
                    case 'transferCallMany':
                      this.chooseDatas.push(nodeObj);
                      break;
                    case 'intercomBoxEntranceTemp':
                    case 'intercomBoxEntrancePocAdd':
                      //不支持添加
                      break;
                    case 'StartGroupChat':
                    case 'messagesChoosePeopleOrMemberChat':
                      this.chooseDatas.push(nodeObj);
                      break;
                    default:
                      this.chooseDatas.push(nodeObj);
                  }
                }
              }

            }
          }
          setTimeout(() => {
            if (this.chooseDatas.length > 0)
              console.log(this.chooseDatas);
            for (let i = 0; i < this.chooseDatas.length; i++) {
              var node = this.$refs[this.activeRef].getNode(parseInt(this.chooseDatas[i].id));
              console.log(this.chooseDatas[i].extnum);
              if (node != null && node.checked === false) {
                node.checked = true;
              }
            }

          }, 200);
        }

      }, /**
       * 选择集团，选择下成员
       * @param data
       * @returns {boolean}
       */
      feeltChooseDatas(parentData, childNodesDatas) {
        console.log('当前节点数据');
        console.log(childNodesDatas);

        function isHasObj(arr, val) {
          var flag = false; // true为有 false为没有
          for (var i = 0; i < arr.length; i++) {
            if (JSON.stringify(arr[i]).indexOf(JSON.stringify(val)) != -1) {
              flag = true;
            }
          }
          return flag;
        }

        let childNodes = childNodesDatas.childNodes;
        if (childNodes.length > 0) {
          for (let n = 0; n < childNodes.length; n++) {
            if (childNodes[n].data.type == 2 || childNodes[n].data.type == 5) {
              var nodeObj = {};
              let data = childNodes[n].data;
              console.log(data);
              nodeObj.id = data.id;
              nodeObj.type = data.type;
              nodeObj.extnum = data.extnum;
              nodeObj.number = data.number;
              nodeObj.systemNumber = data.System_type_num;
              nodeObj.zhognduanTypeId = data.zhognduanTypeId;
              nodeObj.zhognduanTypeName = data.zhognduanTypeName;
              nodeObj.name = data.name;
              var keyIndex = isHasObj(this.chooseDatas, nodeObj.number);
              if (keyIndex) {
                return false;
              } else {
                if (this.courentType != '' || this.courentType != 'undefined') {
                  switch (this.courentType) {
                    case 'transferCallSingel': //转接 只能选择单个
                    case 'VoipDispatchCallBridge': //转接 只能选择单个
                      if (nodeObj.zhognduanTypeId != this.stateAllSubTypeObj.pocID &&
                          nodeObj.zhognduanTypeId != this.stateAllSubTypeObj.NDDH202 &&
                          nodeObj.zhognduanTypeId != this.stateAllSubTypeObj.GHZD203 &&
                          nodeObj.zhognduanTypeId != this.stateAllSubTypeObj.SIPZD201) {
                      } else {
                        if (this.chooseDatas.length > 1) {
                          // this.$message.warning('转接不能多选');
                          for (var i = 0; i < this.chooseDatas.length; i++) {
                            if (nodeObj.id === this.chooseDatas[i].id) {
                              this.deleteMember(data.extnum);
                            }
                          }
                        } else {
                          this.chooseDatas.push(nodeObj);

                        }
                      }

                      break;
                    case 'transferCallMany':
                      if (nodeObj.zhognduanTypeId != this.stateAllSubTypeObj.pocID &&
                          nodeObj.zhognduanTypeId != this.stateAllSubTypeObj.NDDH202 &&
                          nodeObj.zhognduanTypeId != this.stateAllSubTypeObj.GHZD203 &&
                          nodeObj.zhognduanTypeId != this.stateAllSubTypeObj.SIPZD201) {
                      } else {
                        this.chooseDatas.push(nodeObj);
                      }
                      break;
                    case 'StartGroupChat':
                    case 'intercomBoxEntranceTemp':
                    case 'intercomBoxEntrancePocAdd':
                    case 'messagesChoosePeopleOrMemberChat':
                      if (nodeObj.zhognduanTypeId != this.stateAllSubTypeObj.pocID &&
                          nodeObj.zhognduanTypeId != this.stateAllSubTypeObj.NDDH202) {
                        // this.$message.error('只支持sip电话、poc终端、内调电话、固话电话');
                      } else {
                        this.chooseDatas.push(nodeObj);
                      }
                      break;
                    default:
                      this.chooseDatas.push(nodeObj);
                  }
                }
              }

            }
          }
          setTimeout(() => {
            if (this.chooseDatas.length > 0)
              console.log(this.chooseDatas);
            for (let i = 0; i < this.chooseDatas.length; i++) {
              var node = this.$refs[this.activeRef].getNode(parseInt(this.chooseDatas[i].id));
              if (node != null && node.checked === false) {
                node.checked = true;
              }
            }

          }, 100);
        }

      },

      deleteAllNotChooseData(childNodesDatas) {
        let childNodes = childNodesDatas.childNodes;
        if (childNodes.length > 0) {
          if (this.chooseDatas.length > 0)
            for (let n = 0; n < childNodes.length; n++) {
              if (childNodes[n].data.type == 2 || childNodes[n].data.type == 5) {
                var nodeObj = {};
                let data = childNodes[n].data;
                console.log(data);
                nodeObj.id = data.id;
                nodeObj.type = data.type;
                nodeObj.extnum = data.extnum;
                nodeObj.number = data.number;
                nodeObj.systemNumber = data.System_type_num;
                nodeObj.zhognduanTypeId = data.zhognduanTypeId;
                nodeObj.zhognduanTypeName = data.zhognduanTypeName;
                nodeObj.name = data.name;
                if (this.chooseDatas.length > 0) {
                  for (let i = 0; i < this.chooseDatas.length; i++) {
                    /*if (JSON.stringify(this.chooseDatas[i].extnum).indexOf(JSON.stringify(nodeObj.extnum)) != -1) {
                      var node = this.$refs[this.activeRef].getNode(parseInt(nodeObj.id));
                      if (node != null && node.checked == true) {
                        node.checked = false;
                      }
                      this.chooseDatas.splice(i, 1);*/
                      if (nodeObj.extnum === this.chooseDatas[i].extnum) {
                        var node = this.$refs[this.activeRef].getNode(parseInt(nodeObj.id));
                        if (node != null && node.checked == true) {
                          node.checked = false;
                        }
                        this.chooseDatas.splice(i, 1);
                      }
                    }
                }
              }
            }
        }

      },
      //删除节点数据
      deleteMember(item) {
        let extnum = item.id;
        console.log('分机号' + extnum);
        console.log(this.chooseDatas);
        for (var i = 0; i < this.chooseDatas.length; i++) {
          if (extnum == this.chooseDatas[i].id) {
            this.chooseDatas.splice(i, 1);
            try {
              var node0 = this.$refs.agenttree.getNode(extnum);
            } catch (e) {
            }
            try {
              var node1 = this.$refs.zzjgtree.getNode(extnum);

            } catch (e) {
            }
            try {
              var node2 = this.$refs.grouptree.getNode(extnum);

            } catch (e) {
            }
            try {
              var node3 = this.$refs.SystemAddressBooktree.getNode(extnum);

            } catch (e) {
            }
            try {
              var node4 = this.$refs.PersonalAddressBooktree.getNode(extnum);

            } catch (e) {
            }
            console.log(node0);
            console.log(node1);
            console.log(node2);
            console.log(node3);
            console.log(node4);
            try {
              if (node0 != null) {
                node0.checked = false;
              } else if (node1 != null) {
                node1.checked = false;
              } else if (node2 != null) {
                node2.checked = false;
              } else if (node3 != null) {
                node3.checked = false;
              } else if (node4) {
                node4.checked = false;
              }
            } catch (e) {
            }

          }
        }
      },
      deleteMember2(id) {
        for (var i = 0; i < this.chooseDatas.length; i++) {
          if (id === this.chooseDatas[i].id) {
            this.chooseDatas.splice(i, 1);
            var node0 = this.$refs.agenttree.getNode(id);
            var node1 = this.$refs.zzjgtree.getNode(id);
            var node2 = this.$refs.grouptree.getNode(id);
            var node3 = this.$refs.SystemAddressBooktree.getNode(id);
            var node4 = this.$refs.PersonalAddressBooktree.getNode(id);
            if (node1 != null) {
              node1.checked = false;
            } else if (node1 != null) {
              node2.checked = false;
            } else if (node0 != null) {
              node0.checked = false;
            } else if (node3 != null) {
              node3.checked = false;
            } else if (node4 != null) {
              node4.checked = false;
            }
          }
        }
      },

      // 弹出框关闭后触发
      handleClose() {
        // 子组件调用父组件方法，并传递参数
        this.$emit('changeShow', 'false');
      },
      close() {
        // 子组件调用父组件方法，并传递参数
        this.$emit('changeShow', 'false');
        this.chooseDatas = [];
        this.money = '';
      },
      //确定提交，调用父组件方法，传递数据
      handleConfirm() {
        if (this.courentType) {
          switch (this.courentType) {
            case 'StartGroupChat':
              let validate = false;
              console.log(this.$refs['ruleForm']);
              this.$refs['ruleForm'].validate((valid) => {
                if (valid) {
                  validate = true;
                } else {
                  validate = false;
                  return false;
                }
              });
              if (validate === false) {
                return;
              }
              this.$emit('childConfirm', this.chooseDatas, this.courentType, this.ruleForm.name);
              this.IntercomGroup = false;
              this.chooseDatas = [];
              this.money = '';
              this.ruleForm.name = '';
              break;
            case 'intercomBoxEntranceTemp'://临时对讲组，必须选择两数据
              if (this.chooseDatas < 2) {
                this.$message.warning('至少添加两个成员或者组！');
                return;
              }
              let validateI = false;
              this.$refs['intercomTemRuleForm'].validate((valid) => {
                if (valid) {
                  validateI = true;
                } else {
                  validateI = false;
                  return false;
                }
              });
              if (validateI === false) {
                return;
              }
              this.$emit('childConfirm', this.chooseDatas, this.courentType, this.intercomTempRuleForm.name);
              this.IntercomGroup = false;
              this.chooseDatas = [];
              this.money = '';
              this.intercomTempRuleForm.name = '';
              break;

            default :
              this.$emit('childConfirm', this.chooseDatas, this.courentType, null);
              this.IntercomGroup = false;
              this.chooseDatas = [];
              this.money = '';
              break;

          }

        }

      },
      //清除全部
      clearOne() {
        this._handleDeleteKey();
      },
      //处理按键
      _handleKeyPress(e) {
        let num = e.target.dataset.num;
        //不同按键处理逻辑
        // -1 代表无效按键，直接返回
        if (num == -1) return false;
        if (num === undefined) return false;
        switch (String(num)) {
            //小数点
          case '.':
            this._handleDecimalPoint();
            break;
            //删除键
          case 'D':
            this.money = '';
            break;
            //清空键
          case 'C':
            this._handleClearKey();
            break;
            //确认键
          case 'QR':
            this._handleConfirmKey();
            break;
          default:
            this._handleNumberKey(num);
            break;
        }
      },
      //处理删除键
      _handleDeleteKey() {
        let S = this.money;
        //如果没有输入，直接返回
        if (!S.length) return false;
        //否则删除最后一个
        this.money = S.substring(0, S.length - 1);
      },
      //处理清空键
      _handleClearKey() {
        this.money = '';
      },
      _handleConfirmKey() {
        let S = this.money;
        //未输入
        if (!S.length) {
          this.$message.warning('您目前未输入!');
          return false;
        }
        this.confirmEvent(S);
      },
      //处理数字
      _handleNumberKey(num) {
        let S = this.money;
        //没有小数点
        if (!(S.indexOf('.') > -1)) {
          this.money = S + num;
        }
      },
      // 键盘确认事件
      confirmEvent(S) {
        CommonChooseDialogApi.queryByExtNumber({
          extnum: this.money,
        }).then((res) => {
              if (res.success) {
                if (res.obj.length == 0) {
                  this.$message.warning('终端不存在');
                } else {
                  if (this.courentType != '' || this.courentType != 'undefined') {
                    switch (this.courentType) {
                      case 'transferCallMany': //转接多方 可以转接：sip电话、调度台席、群组、手机app、
                        var changeData = [];
                        changeData.push(res.obj[0]);
                        var stateAllSubTypeDatas = this.stateAllSubTypeDatas;
                        for (let t = 0; t < stateAllSubTypeDatas.length; t++) {
                          for (let i = 0; i < changeData.length; i++) {
                            if (stateAllSubTypeDatas[t].ID == changeData[i].subTypeId) {
                              changeData[i]['zhognduanTypeName'] = stateAllSubTypeDatas[t].name;
                              changeData[i]['zhognduanTypeId'] = stateAllSubTypeDatas[t].ID;
                            }
                          }
                        }
                        for (let i = 0; i < changeData.length; i++) {
                          if (changeData[i].utype == 2) { //utype:2终端 ；3群组
                            //可选终端类型：16：sip电话、1：手机app（poc终端）、
                            if (changeData[i].zhognduanTypeId != this.stateAllSubTypeObj.pocID &&
                                changeData[i].zhognduanTypeId != this.stateAllSubTypeObj.NDDH202 &&
                                changeData[i].zhognduanTypeId != this.stateAllSubTypeObj.GHZD203 &&
                                changeData[i].zhognduanTypeId != this.stateAllSubTypeObj.SIPZD201) {
                              this.$message.error('只支持sip电话、poc终端、内调电话、固话电话');
                              return;
                            }
                          }

                          this.numberAppend(res.obj[0]);

                        }
                        break;
                      case 'addNoticeMember': //添加通知
                        var changeData = [];
                        changeData.push(res.obj[0]);
                        var stateAllSubTypeDatas = this.stateAllSubTypeDatas;
                        for (let t = 0; t < stateAllSubTypeDatas.length; t++) {
                          for (let i = 0; i < changeData.length; i++) {
                            if (stateAllSubTypeDatas[t].ID == changeData[i].subTypeId) {
                              changeData[i]['zhognduanTypeName'] = stateAllSubTypeDatas[t].name;
                              changeData[i]['zhognduanTypeId'] = stateAllSubTypeDatas[t].ID;
                            }
                          }
                        }
                        for (let i = 0; i < changeData.length; i++) {
                          if (changeData[i].utype == 2) { //utype:2终端 ；3群组
                            //可选终端类型：16：sip电话、1：手机app（poc终端）、
                            if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.pocID ||
                                changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.NDDH202 ||
                                changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.GHZD203 ||
                                changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                              this.numberAppend(res.obj[0]);
                            } else {
                              this.$message.error('只支持sip电话、poc终端、内调电话、固话电话');
                              return;
                            }
                          } else if (changeData[i].utype == 5) {
                            //TODO 拨号盘台席确认
                            res.obj[0].number = res.obj[0].id;
                            this.numberAppend(res.obj[0]);
                          } else if (changeData[i].utype == 3) {
                            this.$message.error('不支持选择组！');
                          }

                        }
                        break;
                      case 'transferCallSingel':
                      case 'VoipDispatchCallBridge'://转接多方 可以转接：sip电话、调度台席、群组、手机app、
                        var changeData = [];
                        changeData.push(res.obj[0]);
                        var stateAllSubTypeDatas = this.stateAllSubTypeDatas;
                        for (let t = 0; t < stateAllSubTypeDatas.length; t++) {
                          for (let i = 0; i < changeData.length; i++) {
                            if (stateAllSubTypeDatas[t].ID == changeData[i].subTypeId) {
                              changeData[i]['zhognduanTypeName'] = stateAllSubTypeDatas[t].name;
                              changeData[i]['zhognduanTypeId'] = stateAllSubTypeDatas[t].ID;
                            }
                          }
                        }
                        for (let i = 0; i < changeData.length; i++) {
                          if (changeData[i].utype == 2) { //utype:2终端 ；3群组
                            //可选终端类型：16：sip电话、1：手机app（poc终端）、
                            if (changeData[i].zhognduanTypeId != this.stateAllSubTypeObj.pocID &&
                                changeData[i].zhognduanTypeId != this.stateAllSubTypeObj.NDDH202 &&
                                changeData[i].zhognduanTypeId != this.stateAllSubTypeObj.GHZD203 &&
                                changeData[i].zhognduanTypeId != this.stateAllSubTypeObj.SIPZD201) {
                              this.$message.error('只支持sip电话、poc终端、内调电话、固话电话');
                              return;
                            }
                          }
                        }
                        this.numberAppend(res.obj[0]);
                        break;
                      case 'intercomBoxEntranceTemp':
                      case 'intercomBoxEntrancePocAdd'://针对对讲模块-过滤集团、话机
                        var changeData = [];
                        changeData.push(res.obj[0]);
                        var stateAllSubTypeDatas = this.stateAllSubTypeDatas;
                        for (let t = 0; t < stateAllSubTypeDatas.length; t++) {
                          for (let i = 0; i < changeData.length; i++) {
                            if (stateAllSubTypeDatas[t].ID == changeData[i].subTypeId) {
                              changeData[i]['zhognduanTypeName'] = stateAllSubTypeDatas[t].name;
                              changeData[i]['zhognduanTypeId'] = stateAllSubTypeDatas[t].ID;
                            }
                          }
                        }
                        for (let i = 0; i < changeData.length; i++) {
                          if (changeData[i].utype == 2) { //utype:2终端 ；3群组
                            //可选终端类型：16：sip电话、1：手机app（poc终端）、
                            if (changeData[i].zhognduanTypeId == this.stateAllSubTypeObj.SIPZD201) {
                              this.$message.error('无法选择话机进行对讲');
                              return;
                            }
                          }
                        }
                        this.numberAppend(res.obj[0]);
                        break;
                      default:
                        this.numberAppend(res.obj[0]);

                    }
                  }
                }
              } else {
                this.$message.warning('终端不存在');
              }
            },
        ).catch((error) => {
        });
      },

    },

  }
  ;
</script>
<style scoped>
    .chooseDatasBoxItem {
        margin-top: 2px;
        height: 60px;
        width: 100%;
        /*background-color: #b82f2f;*/
        position: relative;
    }

    .chooseDatasBoxItem-left {
        position: absolute;
        left: 0%;
    }

    .chooseDatasBoxItem-center {
        position: absolute;
        left: 60px;
    }

    .chooseDatasBoxItem-right {
        position: absolute;
        right: 5px;
        top: 50%;
        transform: translateY(-50%);
    }

    .chooseDatasBoxItem-leftBox {
        width: 60px;
        height: 60px;
        /*background-color: #eac6c6;*/
    }

    .chooseDatasBoxItem-centerBox {
        width: 300px;
        height: 60px;
        /*background-color: #263ad5;*/
    }

    .chooseDatasBoxItem-rightBox {
        width: 100px;
        height: 60px;
    }


    /* 树形结构节点添加连线 */
    /*.tree /deep/ .el-tree-node {
        position: relative;
        padding-left: 16px;
    }

    .tree /deep/ .el-tree-node__children {
        padding-left: 16px;
    }

    .tree /deep/ .el-tree-node :last-child:before {
        height: 38px;
    }

    .tree /deep/ .el-tree > .el-tree-node:before {
        border-left: none;
    }

    .tree-container /deep/ .el-tree > .el-tree-node:after {
        border-top: none;
    }

    .tree /deep/ .el-tree-node:before {
        content: "";
        left: -4px;
        position: absolute;
        right: auto;
        border-width: 1px;
    }

    .tree /deep/ .el-tree-node:after {
        content: "";
        left: -4px;
        position: absolute;
        right: auto;
        border-width: 1px;
    }
    .tree /deep/ .el-tree-node__expand-icon.is-leaf {
        display: none;
    }

    .tree /deep/ .el-tree-node:before {
        border-left: 1px solid #b8b9bb;
        bottom: 0px;
        height: 100%;
        top: -26px;
        width: 1px;
    }

    .tree /deep/ .el-tree-node:after {
        border-top: 1px solid #b8b9bb;
        height: 20px;
        top: 12px;
        width: 24px;
    }
*/

</style>
<style src="@/assets/css/components/intercomGroup1280.css" scoped></style>
<style src="@/assets/css/components/intercomGroup1080.css" scoped></style>
<style>
    /*无数据字体大小*/
    .el-tree__empty-text{
        font-size: 20px!important;
    }
</style>

